Component({
    options: {
        multipleSlots: !0,
        addGlobalClass: !0
    },
    properties: {
        title: {
            type: String,
            value: ""
        },
        showCancel: {
            type: Boolean,
            value: !0
        },
        cancelText: {
            type: String,
            value: "取消"
        },
        maskClass: {
            type: String,
            value: ""
        },
        extClass: {
            type: String,
            value: ""
        },
        maskClosable: {
            type: Boolean,
            value: !0
        },
        mask: {
            type: Boolean,
            value: !0
        },
        show: {
            type: Boolean,
            value: !1
        },
        actions: {
            type: Array,
            value: [],
            observer: "_groupChange"
        },
        keyBoardType: {
            type: Number,
            value: 1
        },
        backgroundColor: {
            type: String,
            value: "#ffffff"
        },
        isAdaptive: {
            type: Boolean,
            value: false
        }
    },
    data: {
        keyNumber: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0],
        keyEnInput1: ["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"],
        keyEnInput2: ["A", "S", "D", "F", "G", "H", "J", "K", "L"],
        keyEnInput3: ["Z", "X", "C", "V", "B", "N", "M"],
        keyPhone: [1, 2, 3, 4, 5, 6, 7, 8, 9, "+", 0],
        carCard0: ["京", "沪", "浙", "苏", "粤", "鲁", "晋", "冀", "豫", "川"],
        carCard1: ["渝", "辽", "吉", "黑", "皖", "鄂", "湘", "赣", "闽", "陕"],
        carCard2: ["甘", "宁", "蒙", "津", "贵", "云", "桂", "琼", "青", "新"],
        carCard3: ["藏", "使", "领", "警", "学", "港", "澳"],
        hexNumber: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "A", "B", "C", "D", "E", "F"],
        bottom: "0",
        keyBoardType: 1,
        backgroundColor: "#ffffff",
        isAdaptive: !1
    },
    ready: function () {
        console.log('ready')
        this.setData({
            keyBoardType: this.properties.keyBoardType,
            backgroundColor: this.properties.backgroundColor,
            isAdaptive: this.properties.isAdaptive
        })
        this.properties.isAdaptive ? this.setData({
            bottom: "60rpx"
        }) : this.setData({
            bottom: "0"
        });
    },
    show() {
        console.log('show', this.properties.keyBoardType)
    },
    methods: {
        switchType: function () {
            let keyBoardType = this.data.keyBoardType == 3 ? 4 : 3;
            this.setData({
                keyBoardType
            })
        },
        vehicleTap: function (e) {
            wx.vibrateShort();
            var t = e.target.dataset.value;
            this.triggerEvent("inputPress", {
                value: t
            });
        },
        longPressDelete: function (e) {
            var t = e.target.dataset.value;
            this.triggerEvent("inputLongPress", {
                value: t
            });
        },
        _groupChange: function (e) {
            e.length > 0 && "string" != typeof e[0] && !(e[0] instanceof Array) && this.setData({
                actions: [this.data.actions]
            });
        },
        buttonTap: function (e) {
            console.log(e)
            var t = e.currentTarget.dataset,
                r = t.value,
                a = t.groupindex,
                o = t.index;
            this.triggerEvent("actiontap", {
                value: r,
                groupindex: a,
                index: o
            });
        },
        closeActionSheet: function (e) {
            var t = e.currentTarget.dataset.type;
            (this.data.maskClosable || t) && (this.setData({
                show: !1
            }), this.triggerEvent("close"));
        }
    }
});